STEP 4: Now let's use a loop to cycle through the list.

  • Click on . Drag out Loop through List.
  • Change the loop variable from value to x. Change the loop list name from my_list to inputs.
  • Click into the code editor, inside the loop.
  • Type your linear function rule: y = 2 * x. Be sure it's indented 4 spaces inside the loop!

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)